

import 'dart:io';

import 'package:flutter/material.dart';

class DirImage extends StatelessWidget {

  final String url;
  final double? height;
  final double? width;

  final BoxFit fit;

  // ignore: use_key_in_widget_constructors
  const DirImage({Key? key, required this.url, this.height, this.width, this.fit = BoxFit.cover});

  @override
  Widget build(BuildContext context) {
    if (url.contains('asset')) {
      return Image.asset(url, width: width, height: height,fit: fit,);
    }
    return Image.file(File(url), width: width, height: height,fit: fit,);
  }
}
